 function startit()
 {
 
        code = $(".wx_right").html();
        bee = $("#bee").text();                 
        url="./index.php?act=payment&op=checkpay";
        url2="./index.php?act=buy&op=pay_ok&pay_sn="+code+"&pay_amount="+bee;
        $.ajax({
                type: "post",
                url: url,
                data:{code:code,act:1},
                dataType: "json",
                success: function (data) {
                       if(data.ret=="1")
                       {
                        console.log(data.msg);
                        window.location.href=url2;
                       }else
                       {
                          console.log(data.msg);
                         // window.location.href=url2;
                       }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                        console.log(errorThrown);
                }
        });                     
      
                
 
 }
 
 $(function(){     
  setInterval(startit,3000);    
     
 });